package com.payment.service;

import com.payment.entity.common.OrderPaymentManager;
import com.payment.entity.common.OrderRefPackageManager;
import com.payment.entity.common.UserboundPaymentOrder;

import java.util.List;

public interface OrderPaymentManagerService {

    public void storageOrderPayment(OrderPaymentManager userOrder);

    public void updateOrderIdByRequestOrderIdAndDeviceId(OrderPaymentManager user);

    public void updateIsOpenAndNotify(OrderPaymentManager userOrder);

    public List<OrderPaymentManager> getListToOpen();

    public int findOrderIdByNotify(String orderId);

    public void updateIsNotify(OrderPaymentManager paymentOrder);

    public List<OrderPaymentManager> getOrderResultsList(String orderId, String deviceId);

    public void updateIsChannelNotity(OrderPaymentManager paymentOrder);

    public List<OrderPaymentManager> getChannelResultList();

    public void insertRefPackage(OrderRefPackageManager ref);

    public void UpdatePaypalNotify(UserboundPaymentOrder order);

    public int findDataByRequestOrderId(String requestOrderId, String deviceId, String orderPeriod, String partnerCode, String packageCode);

    public UserboundPaymentOrder queryPaymentOrderByOrderId(String orderId, String amount);

    public void updateIsNotifyOrderT(OrderPaymentManager paymentManager);

    public void UpdatePaypalNotifyById(UserboundPaymentOrder order);

    /**
     * 查询数据库里面有没有这条回调数据
     *
     * @param orderNo
     * @return
     */
    Integer findOrderCodeByNotify(String orderNo);

    /**
     * 回调数据更新数据表
     *
     * @param paymentOrder
     * @return
     */
    Integer updatePayRstById(OrderPaymentManager paymentOrder);

    /**
     * 根据上报的orderNo和requestOrderId查询订单记录
     *
     * @param orderNo
     * @param requestOrderId
     * @return
     */
    OrderPaymentManager queryOrderByOrderId(String orderNo, String requestOrderId);

    /**
     * 去数据库更新orderId等字段
     *
     * @param order
     * @return
     */
    Integer updateOrderId(OrderPaymentManager order);

    /**
     * payPal-webHook 回调去入库：user_order_payment_manager_t
     *
     * @param paymentOrder
     * @return
     */
    Integer updatePayRst(OrderPaymentManager paymentOrder);

    /**
     * 根据orderNo查询订单对象
     *
     * @param orderNo
     * @return
     */
    OrderPaymentManager queryOrderByOrderNo(String orderNo);
}
